<?php echo $html->js('thickbox/thickbox.js');?>
<style type="text/css" media="all">@import "<?php echo $html->js_url('thickbox/thickbox.css'); ?>";</style>
<script type="text/javascript">
$().ready(function() {
    $('.edit_action_button').click(function() {
        $('.action_list').show();
    });
});
</script>
<script type="text/javascript"><!--//--><![CDATA[//><!--

sfHover = function() {
    var sfEls = document.getElementById("editor_menu").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";

        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");

        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]></script>

<table width="100%">
    <tr>
        <td>
<!-- 自定义编辑菜单 start -->

<ul id="editor_menu">
    <!--
    <li><a class="edit_action_button">编辑</a>

        <ul style="display:none;" class="action_list">
            <li><a>撤销</a></li>
            <li><a>恢复</a></li>
            <li><a>剪切</a></li>
            <li><a>复制</a></li>
            <li><a>粘贴</a></li>
            <li><a>全选</a></li>
            <li><a>在线文档样式</a></li>
            <li><a>编辑HTML</a></li>
        </ul>

    </li>
        -->
    <li><a class="edit_action_button">插入</a>
        <ul style="display:none;" class="action_list">
            <li><?php echo $html->admin_link('图片', '/editor/insert_image/' . $upload_session, array('id'=>'add_image', 'class'=>'thickbox', 'tip'=>'Add a Image')); ?></li>
            <!--
            <li><a>链接</a></li>
            <li><a>表格</a></li>
            <li><a>注释</a></li>
            <li><a>特殊字符</a></li>
            <li><a>水平线</a></li>
            <li><a>分页符</a></li>
            -->
        </ul>
    </li>
    <!--
    <li><a class="edit_action_button">帮助</a>
        <ul style="display:none;" class="action_list">
            <li><a>文档帮助中心</a></li>
            <li><a>观看视频教程</a></li>
            <li><a>错误报告</a></li>
        </ul>
    </li>
    -->
</ul>

<!-- 自定义编辑菜单 End -->

<div style="float:left; margin:0; padding:0;">

<?php echo $html->js('tinymce/tiny_mce.js'); ?>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
</script>

<?php
echo $html->textarea('Posts/post_content', array('class'=>'mceEditor', 'rows'=>25, 'cols'=>40, 'id'=>'data[Posts][post_content]'));
?>

</div>
        </td>
    </tr>
</table>
